package longcaisuyun.longcai.com.yiliubabalongcaisuyun;

import android.content.Context;
import android.text.SpannableString;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

import longcaisuyun.longcai.com.myview.MTextView;


/**
 * Created by Administrator on 2016/4/7.
 */
public class ShouFeiGZAdapter  extends BaseAdapter {
    Context   context;
    ViewHolder   viewHolder=null;
    List<String> list;
    public ShouFeiGZAdapter(Context   context,List<String>list){
        this.context=context;
        this.list=list;
    }
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        if(convertView==null){
            convertView=View.inflate(context, R.layout.item_shoufei_guize,null);
            viewHolder=new ViewHolder();
            viewHolder.m= (MTextView) convertView.findViewById(R.id.mytext);
            MyApplication.ScaleScreenHelper.loadView((ViewGroup) convertView);
            convertView.setTag(viewHolder);
        }else{
            viewHolder= (ViewHolder) convertView.getTag();
        }
        SpannableString ss = new SpannableString(list.get(position));
        viewHolder.m.setMText(ss);
        return convertView;
    }
    class  ViewHolder{
        public MTextView    m;
    }
}
